package com.db.patterns.prototype.demo04;

import lombok.Data;

@Data
public class Computer {
    private String cpu;
    private String memory;
    private String motherboard;
    private String powerSupply;
    private String graphicsCard;
    private String solidState;
    private String chassis;

    public Computer(Builder builder) {
        this.cpu = builder.cpu;
        this.memory = builder.memory;
        this.motherboard = builder.motherboard;
        this.powerSupply = builder.powerSupply;
        this.graphicsCard = builder.graphicsCard;
        this.solidState = builder.solidState;
        this.chassis = builder.chassis;
    }

    public static final class Builder {
        private String cpu;
        private String memory;
        private String motherboard;
        private String powerSupply;
        private String graphicsCard;
        private String solidState;
        private String chassis;

        public Builder buildCpu(String cpu) {
            this.cpu = cpu;
            return this;
        }

        public Builder buildMemory(String memory) {
            this.memory = memory;
            return this;
        }

        public Builder buildMotherboard(String motherboard) {
            this.motherboard = motherboard;
            return this;
        }

        public Builder buildPowerSupply(String powerSupply) {
            this.powerSupply = powerSupply;
            return this;
        }

        public Builder buildGraphicsCard(String graphicsCard) {
            this.graphicsCard = graphicsCard;
            return this;
        }

        public Builder buildSolidState(String solidState) {
            this.solidState = solidState;
            return this;
        }

        public Builder buildChassis(String chassis) {
            this.chassis = chassis;
            return this;
        }

        public Computer build() {
            return new Computer(this);
        }
    }
}
